package org.come.action;

import io.netty.channel.ChannelHandlerContext;
import org.cbg.control.*;
import org.codeCard.control.SaleCardMySearchControl;
import org.codeCard.control.SaleCardSearchControl;
import org.come.MountShouHu.ShouHuControl;
import org.come.baitan.BaiTanMessageControl;
import org.come.bean.Account_BindingControl;
import org.come.bean.Account_LoginControl;
import org.come.bean.AreaStatuesControl;
import org.come.bean.ZhuShouControl;
import org.come.control.*;
import org.come.control.festival.GiveGoodsControl;
import org.come.control.festival.HatchValueControl;
import org.come.login.LoginControl;
import org.come.npc.*;
import org.come.socket.AgreementUtil;
import org.come.until.MessageProcessUntil;
import org.come.until.NpcMenuUntil;
import org.come.xinyuan.XinyuanControl;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @author 处理服务器接受方法
 * 
 */
public class MapAction {
    /** zrikka 2020 - 0414 */
    // 通道连接池 键: ip|port
    public static Map<String, ChannelHandlerContext> nettyAction = new HashMap<String, ChannelHandlerContext>();
    // 通道标识 键: ip|port
    public static Map<String, Boolean> flagAction = new HashMap<String, Boolean>();
    /***************/
	/**
	 * 处理服务返回消息接口
	 */
	public static Map<String, FromServerAction> serverAction = new HashMap<String, FromServerAction>();
	/**
	 * 处理npc菜单方法接口
	 */
	public static Map<String, NpcMenuAction> npcmenuAction = new HashMap<String, NpcMenuAction>();

	public static ServerMesControl mesControl = new ServerMesControl();// 服务器接收
	static {
		serverAction.put(AgreementUtil.kejunpc, new KejuControl());
		/**天梯*/
        serverAction.put(AgreementUtil.ladderArena, new TeamArenaControl(AgreementUtil.ladderArena));
		LoginControl loginControl = new LoginControl();
		serverAction.put(AgreementUtil.rigistersuccess, loginControl);
		serverAction.put(AgreementUtil.rigistererror, loginControl);
		serverAction.put(AgreementUtil.loginsuccess, loginControl);
		serverAction.put(AgreementUtil.loginerror, loginControl);
		serverAction.put(AgreementUtil.createsuccess, loginControl);
		serverAction.put(AgreementUtil.createerror, loginControl);
		serverAction.put(AgreementUtil.modifyPwdError, loginControl);
		serverAction.put(AgreementUtil.modifyPwdSuccess, loginControl);
		serverAction.put(AgreementUtil.version, new VersionControl());// 版本号确定
		serverAction.put(AgreementUtil.ZHU_SHOU, new ZhuShouControl());// 游戏助手
		// 进行孩子抚养确认
		serverAction.put(AgreementUtil.babycustoday, new BabycustodayControl());
		// 进入游戏
		serverAction.put(AgreementUtil.intogame, new IntoGameControl());
		// 服务器停止运行
		serverAction.put(AgreementUtil.npcdialog, new NPCDialogControl());
		serverAction.put(AgreementUtil.npc, new NPCDialogControl2());
		// 接收战斗等数据
		serverAction.put(AgreementUtil.fightingrounddeal, new FightingrounddealControl());
		serverAction.put(AgreementUtil.fightingroundend, new FightingroundendControl());
		serverAction.put(AgreementUtil.battlestate, new BattleStateControl());
		serverAction.put(AgreementUtil.fightingend, new BattleEndControl());
		serverAction.put(AgreementUtil.battleconnection, new BattleConnectionControl());

		serverAction.put(MessageProcessUntil.prompt, new PromptControl());
		// 获取召唤兽信息
		serverAction.put(MessageProcessUntil.pet, new PetControl());
		// 结婚
		serverAction.put(MessageProcessUntil.marry, new MarryControl());

		serverAction.put("stallmessage",new BaiTanMessageControl());
		serverAction.put(MessageProcessUntil.monster, new MonsterRefreshControl());

		// 组队
		serverAction.put(AgreementUtil.upRoleShow, new UpRoleShowControl());
		// 实例化聊天信息
		serverAction.put(AgreementUtil.chat, new NChatControl());
		// 摊位详细信息
		serverAction.put(MessageProcessUntil.stall, new StallControl());
		// 更新摊位状态
		serverAction.put(MessageProcessUntil.stallstate, new StallStateControl());
		// 资源获取
		serverAction.put(MessageProcessUntil.asset, new AssetControl());
		// 更改称谓
		serverAction.put(MessageProcessUntil.titlelist, new RoleChangeAppellationControl());
		// 种族转换
		serverAction.put(MessageProcessUntil.racialtransformation, new RoleConversionControl());
		// 坐骑的按钮功能
		serverAction.put(MessageProcessUntil.mount, new MountFunctionControl());
		serverAction.put(MessageProcessUntil.friend, new FriendServerControl());
		serverAction.put(MessageProcessUntil.friendchat, new FriendChatControl());
		//飞行器的按钮功能
		serverAction.put(MessageProcessUntil.fly,new FlyFunctionControl());
//		serverAction.put(AgreementUtil.jiqiren,new JirenjiaobenchuliControl());
		// 背包信息
		serverAction.put(AgreementUtil.addgood, new AddGoodControl());
		// 宝宝
		serverAction.put(MessageProcessUntil.baby, new BabyControl());
		// 结婚//洞房
		serverAction.put(MessageProcessUntil.marry, new MarryControl());
		// 帮派
		serverAction.put(AgreementUtil.gangchange, new GangChangeControl());//帮派信息更改
        serverAction.put(AgreementUtil.intogang, new IntogangControl());//获取帮派信息
		serverAction.put(AgreementUtil.ganglist, new GanglistControl());//获取所有帮派
		serverAction.put(AgreementUtil.gangstate, new GangStateControl());//帮战相关
		serverAction.put(AgreementUtil.bangtz, new BangCControl());//帮战挑战
		serverAction.put(AgreementUtil.givemoney, new GangGiveMoneyControl());//帮战捐款
		
		npcmenuAction.put(NpcMenuUntil.getMenu80(), new GangsGuardControl());//更换帮派主守护
		npcmenuAction.put(NpcMenuUntil.getMenu81(), new GangsGuardControl());//更换帮派副守护
		
		npcmenuAction.put(NpcMenuUntil.getMenu82(), new EggControl());//领取元气蛋
		
		// 玩家退出
		serverAction.put(AgreementUtil.userretreat, new UserretreatControl());
		serverAction.put(AgreementUtil.intogame, new IntoGameControl());
		// 仙玉充值
		serverAction.put(MessageProcessUntil.applypay, new ApplyPayControl());
		// 接收服务器典当返回的消息
		serverAction.put(MessageProcessUntil.USER_DIANDANG, new GetPawmControl());
		// 升级处理
		serverAction.put(AgreementUtil.rolelevelup, new RoleLevelUpControl());
		// 人物移动
		serverAction.put(AgreementUtil.move, new MoveControl());
		// 修改名称
		serverAction.put(MessageProcessUntil.changerolename, new ChangerolenameControl());
		// 回复协议头
		serverAction.put(MessageProcessUntil.pong, new ServerPongControl());
		// 任务
		serverAction.put(AgreementUtil.TASKN, new TaskNControl());
		// 中量级数据广播
		serverAction.put(AgreementUtil.middle, new MiddleControl());
		// 获取赏功堂物品
		serverAction.put(MessageProcessUntil.obtainarticle, new RewardHallControl());
		// 抽中物品
		serverAction.put(MessageProcessUntil.drawnitems, new RewardHallControl());
		// 抽物品失败
		serverAction.put(MessageProcessUntil.drawnitemsfail, new RewardHallControl());
		// 获取排行榜信息
		serverAction.put(MessageProcessUntil.pankinglist, new RankingListControl());
		// 进入游戏改
		serverAction.put(AgreementUtil.enterGame, new EnterGameControl());
		// 提示消息
		serverAction.put(AgreementUtil.tip, new ReturnTipControl());
		// 下挑战书
		serverAction.put(AgreementUtil.bookofchalg, new ReturnTipControl());
		// 获取通灵宝券信息
		serverAction.put(AgreementUtil.getfivemsg, new QuackGameControl());
		// 额外属性操作
		serverAction.put(AgreementUtil.extrattroper, new ExtraAttrOperControl());
		// 修改收录数据
		serverAction.put(AgreementUtil.packRecord, new PackRecordControl());
		// 展示点击
		serverAction.put(AgreementUtil.richM, new RichMonitorControl());
		serverAction.put(AgreementUtil.searcahChatRoleId, new SearcahChatControl());
		serverAction.put(AgreementUtil.shop, new ShopControl());
		serverAction.put(AgreementUtil.shopGood, new ShopGoodsControl());
		serverAction.put(AgreementUtil.shopPrice, new ShopPriceControl());

		serverAction.put(AgreementUtil.TransState, new TransStateControl());
		serverAction.put(AgreementUtil.TransGood, new TransGoodControl());
		serverAction.put(AgreementUtil.fightQl, new FightQlControl());

		npcmenuAction.put(AgreementUtil.npcdialog, new BangBattleControl());
		
		// npc菜单
		npcmenuAction.put("菜单", new NpcMenuControl());
		npcmenuAction.put(NpcMenuUntil.SKILL, new SkillLearn());
		// 双倍
		npcmenuAction.put(NpcMenuUntil.DBEXP, new DBExp());
		// npc菜单
		npcmenuAction.put(NpcMenuUntil.getMarry(), new MarryInfromantsControl());
		npcmenuAction.put(NpcMenuUntil.getUnMaary(), new MarryInfromantsControl());
		npcmenuAction.put(NpcMenuUntil.getMakelove(), new MakeLoveControl());
		// 查看亲密度
		npcmenuAction.put(NpcMenuUntil.getShowrolesummingfaithful(), new RoleSumminCloseControl());
		// 治疗召唤兽信息
		npcmenuAction.put(NpcMenuUntil.getCurerolesumming(), new RoleSumminCloseControl());
		// 进入帮派
		npcmenuAction.put(NpcMenuUntil.getMenu39(), new GangInto());

		// 日常任务
		npcmenuAction.put(NpcMenuUntil.getMenu48(), new Creeps());
		// 召唤兽转生 //神兽学习技能 //飞升当前参战神兽
		npcmenuAction.put(NpcMenuUntil.getMenu15(), new PetConversion());

		// 住店
		npcmenuAction.put(NpcMenuUntil.getMenu9(), new Sleep());

		// 住店
		npcmenuAction.put(NpcMenuUntil.TP, new FlightChessTP());

		// HP
		npcmenuAction.put(NpcMenuUntil.getMenu51(), new SelectOptionControl());
		// 强制离婚
		npcmenuAction.put(NpcMenuUntil.getMenu52(), new CompulsoryDivorceControl());
		// 监狱
		npcmenuAction.put(NpcMenuUntil.GETOUT, new GetOut());
		npcmenuAction.put(NpcMenuUntil.GOTO, new Gotochangan());
		// 帮派赏功堂
		npcmenuAction.put(NpcMenuUntil.LOTTERY, new GangOperationControl());
		npcmenuAction.put(NpcMenuUntil.THROWIN, new GangOperationControl());
		// 下挑战书
		npcmenuAction.put(NpcMenuUntil.CHALLENGE, new SurfaceAssemblyControl());
		// 兑换灵修值、收录玉符
		npcmenuAction.put(NpcMenuUntil.EXCHANGEVAL, new ExchangeValueControl());
		// 进入移山大殿
		npcmenuAction.put(NpcMenuUntil.WILLENTER, new ExchangeValueControl());
		// 元旦助力活动
		npcmenuAction.put(NpcMenuUntil.GIVEAHAND, new GiveAHandcontrol());
		// 星卡战力补充
		npcmenuAction.put(NpcMenuUntil.STARCARDSUPPLEMENT, new StarCardSupplement());
		// 元旦孵蛋任务接收孵化值
		serverAction.put(AgreementUtil.hatchvalue, new HatchValueControl());
		// 元旦孵蛋任务接收发放奖励
		serverAction.put(AgreementUtil.givegoods, new GiveGoodsControl());

		/** 藏宝阁实例化方法start */
		// 藏宝阁商品搜索实例化方法
		serverAction.put(AgreementUtil.CBGSearch1, new SearchGoodsResultControl());
		// 藏宝阁我的商品实例化方法
		serverAction.put(AgreementUtil.CBGSearch2, new SearchConsignmentGoodsResultControl());
		// 藏宝阁我的订单实例化方法
		serverAction.put(AgreementUtil.CBGSearch3, new SearchMyOrderResultControl());
		// 藏宝阁指定购买实例化方法
		serverAction.put(AgreementUtil.CBGSearch4, new SearchDesignatedPurchaseResultControl());
		// 藏宝阁我的藏宝阁之我的货物搜索实例化方法
		serverAction.put(AgreementUtil.CBGSearch5, new SearchMyGoodsResultControl());
		// 藏宝阁查询消息实例化方法
		serverAction.put(AgreementUtil.CBGSearch6, new SearchMesResultControl());
		// 藏宝阁收藏查询搜索实例化方法
		serverAction.put(AgreementUtil.CBGSearch7, new SearchCollectionQueryControl());
		// 藏宝阁删除消息实例化方法
		serverAction.put(AgreementUtil.CBGMes, new SearchDeleteMessageResultControl());
		// 藏宝阁收藏-收藏取消
		serverAction.put(AgreementUtil.CBGCollect, new SearchColectionStatuesResultControl());
		// 藏宝阁购买按钮
		serverAction.put(AgreementUtil.CBGBuy, new SearchBuyResultControl());
		/** 藏宝阁实例化方法end */
		// 实时决斗排行榜
		serverAction.put(AgreementUtil.DUELBOARD, new DuelBoardControl());

		/** HGC--2019-11-13--start */
		serverAction.put(AgreementUtil.PhoneNumberIsNoGet, new PhoneNumberIsNoGetControl());
		serverAction.put(AgreementUtil.PhoneBang, new PhoneBangControl());
		serverAction.put(AgreementUtil.UnPhoneBang, new UnPhoneBangControl());
		/** HGC--2019-11-13--end */
		serverAction.put(AgreementUtil.Scene, new SceneControl());

		serverAction.put(AgreementUtil.Getvipgradepack, new GetvipgradepackControl());
		serverAction.put(AgreementUtil.Paydaygradepay, new PaydaygradepayControl());
		serverAction.put(AgreementUtil.Dayforweekgradeget, new DayforweekgradegetControl());
		serverAction.put(AgreementUtil.Dayforoneget, new DayforonegetControl());
		serverAction.put(AgreementUtil.chongjipackget, new ChongjipackgetControl());
		
		/** HGC-2020-03-02 */
		serverAction.put(AgreementUtil.REAREA, new RetareaControl());
		serverAction.put(AgreementUtil.UidAndQidForRole, new UidAndQidForRoleControl());
		serverAction.put(AgreementUtil.PhoneNumber, new PhoneNumberControl());
		
		/**组队相关协议头*/
		serverAction.put(AgreementUtil.team1, new TeamControl());
		serverAction.put(AgreementUtil.oneArena, new OneArenaControl());
		/** zrikka 2020 0414 */
        serverAction.put(AgreementUtil.LOGINVERSION, new VersionControl());// 版本号确定
        serverAction.put(AgreementUtil.ACCOUNT_LOGIN, new Account_LoginControl());// 登录结果
        serverAction.put(AgreementUtil.AREASTATUES, new AreaStatuesControl());// 获取所选区状态
        serverAction.put(AgreementUtil.ACCOUNT_BINDING, new Account_BindingControl());// 绑定信息返回
//      serverAction.put(AgreementUtil.version, new LinkSuccessControl());// 游戏服务器连接成功
        /***/
		/**组队竞技*/
        serverAction.put(AgreementUtil.teamArena, new TeamArenaControl(AgreementUtil.teamArena));
        //活动按钮展示与否
        serverAction.put(AgreementUtil.vicon, new ViconControl());
        serverAction.put(AgreementUtil.labor, new LaborControl());
        //幻境试炼
        serverAction.put(AgreementUtil.hjsl, new HjslControl());
        serverAction.put(AgreementUtil.rolechange, new RolechangeControl());
        
        //灵犀
        serverAction.put(AgreementUtil.LINGXI, new LxControl());

		//法门
		npcmenuAction.put(NpcMenuUntil.FMSKILL, new SkillLearn2());
		
		npcmenuAction.put(NpcMenuUntil.XPSKILL, new SkillLearn3());
		
		serverAction.put(AgreementUtil.rolechange1, new RolexingpanControl());
		
		serverAction.put(AgreementUtil.QD, new QianDaoControl());
		//全民竞猜
		serverAction.put(AgreementUtil.QMJC, new QmjcControl());
		//飞行器的按钮功能
//		serverAction.put(MessageProcessUntil.fly,new FlyFunctionControl());

		serverAction.put("xinyuan", new XinyuanControl());

		serverAction.put(AgreementUtil.SaleCardSearch, new SaleCardSearchControl());
		serverAction.put(AgreementUtil.SaleCardMySearch, new SaleCardMySearchControl());
		serverAction.put(AgreementUtil.shaoxiang, new ShaoXiangControl());
		serverAction.put("shouhu", new ShouHuControl());
		serverAction.put(AgreementUtil.autotasklist, new AutoTaskControl());
		serverAction.put(AgreementUtil.HDX, new HDXControl());
		serverAction.put(AgreementUtil.selllianghao, new SellLiangHaoControl());
		serverAction.put(AgreementUtil.ROLEACHIEVE, new AchievemControl());
		serverAction.put(AgreementUtil.UPDATETEXT, new UpdateTextControl());
	}
}
